package com.migration.model.olddb;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * 原因信息表 实体类
 * 表名：ra_deviate_reason
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "ra_deviate_reason")
public class RaDeviateReason implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 项目主键
     */
    @Column(name = "items_id")
    private Long itemsId;
    
    /**
     * 节点主键
     */
    @Column(name = "node_id", nullable = false)
    private Long nodeId;
    
    /**
     * 关联类型（1、偏离 4、操作）
     * 默认值: 1
     */
    @Column(name = "linked_type", nullable = false)
    private Byte linkedType;
    
    /**
     * 偏离主键（20230509更新为关联主键，根据linked_type）
     */
    @Column(name = "linked_id", nullable = false)
    private Long linkedId;
    
    /**
     * 偏离名称（20230509更新为关联名称，根据linked_type）
     */
    @Column(name = "linked_name", length = 256)
    private String linkedName;
    
    /**
     * 步骤详情主键
     */
    @Column(name = "step_detail_id")
    private Long stepDetailId;
    
    /**
     * 原因描述
     */
    @Column(name = "cause_desc", length = 512)
    private String causeDesc;
    
    /**
     * 原因类型
     */
    @Column(name = "cause_type")
    private Byte causeType;
    
    /**
     * 位号
     */
    @Column(name = "bit_num", length = 256)
    private String bitNum;
    
    /**
     * 可能性主键
     */
    @Column(name = "probability_id")
    private Long probabilityId;
    
    /**
     * 可能性等级
     */
    @Column(name = "probability_grade", length = 128)
    private String probabilityGrade;
    
    /**
     * 分组主键
     */
    @Column(name = "group_id")
    private Long groupId;
    
    /**
     * 是否删除（0、否 1、是）
     * 默认值: 0
     */
    @Column(name = "is_del", nullable = false)
    private Byte isDel;
    
    /**
     * 创建时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "create_time", nullable = false)
    private java.time.LocalDateTime createTime;
    
    /**
     * 创建者
     */
    @Column(name = "create_by", length = 64)
    private String createBy;
    
    /**
     * 更新时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "update_time", nullable = false)
    private java.time.LocalDateTime updateTime;
    
    /**
     * 更新者
     */
    @Column(name = "update_by", length = 64)
    private String updateBy;
    
    @Override
    public String toString() {
        return "RaDeviateReason{" +
            "id=" + id +
            ", itemsId=" + itemsId +
            ", nodeId=" + nodeId +
            ", linkedType=" + linkedType +
            ", linkedId=" + linkedId +
            ", linkedName=" + linkedName +
            ", stepDetailId=" + stepDetailId +
            ", causeDesc=" + causeDesc +
            ", causeType=" + causeType +
            ", bitNum=" + bitNum +
            ", probabilityId=" + probabilityId +
            ", probabilityGrade=" + probabilityGrade +
            ", groupId=" + groupId +
            ", isDel=" + isDel +
            ", createTime=" + createTime +
            ", createBy=" + createBy +
            ", updateTime=" + updateTime +
            ", updateBy=" + updateBy +
        '}';
    }
} 